package com.hb.game.pk.adpter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hb.game.pk.R;
import com.hb.game.pk.beans.RoomList;

public class GameRoomListAdapter extends BaseQuickAdapter<RoomList.DataBean, BaseViewHolder> {
    private int[] images = {R.mipmap.ic_sl_s, R.mipmap.ic_rome_er_ba};

    public GameRoomListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, RoomList.DataBean item) {
        int res = 0;
        if (item.getGame().equals("szww")) {
            res = images[1];
        } else {
            res = images[0];
        }
        helper.setImageResource(R.id.iv_room, res);
        helper.setText(R.id.tv_room, item.getTitle());
    }
}
